package com.ny.mapper;
import com.ny.entity.Device;
import org.springframework.data.mongodb.repository.MongoRepository;
import java.util.Date;
import java.util.List;
import java.util.Optional;

public interface DeviceMapper extends MongoRepository<Device, Integer> {
    List<Device> findAll();
    
    List<Device> findByDeviceName(String deviceName);
    
    // 根据时间范围和状态查询设备
    List<Device> findByCreatedTimeBetweenAndStatus(Date startTime, Date endTime, Integer status);
    
    // 根据设备ID删除设备
    void deleteByDeviceId(Integer deviceId);
    
    // 根据设备ID查找设备
    Optional<Device> findById(Integer deviceId);
}